package cn.com.huzo.service.dashboard.impl;

import cn.com.huzo.repository.purchase.PoNoticeRepository;
import cn.com.huzo.service.dashboard.DashBoardManager;
import java.util.HashMap;
import java.util.Map;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * 仪表盘管理接口实现对象
 *
 * @author 吴旭
 */
@Service("DashBoardManager")
public class DashBoardManagerImpl implements DashBoardManager {

    @Resource(name = "PoNoticeRepository")
    private PoNoticeRepository _dao_ponotice;

    /**
     * {@inheritDoc}
     *
     * @throws java.lang.Exception
     */
    @Override
    @Transactional
    public Map<String, Object> fetchDashBoardData(Long userId) throws Exception {
        Map<String, Object> _reuslt = new HashMap();

        // 新产品计划数
        //_reuslt.put("NewMpsCount", _dao_mps.fetchNewMpsCount());
        // 得到该用户的未读采购下单通知
        _reuslt.put("PoNotices", _dao_ponotice.fetchNewNoticeByRecipient(userId));

        return _reuslt;
    }

}
